package javaer.starter.model;

import com.google.common.collect.Lists;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.util.List;

/**
 * 模板
 *
 * @author yangzhen
 * @date 2023/6/5 10:56
 * @since 1.0.0
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class TemplateModel extends BaseModel {

    public static final String SQL_TEMPLATE = "insert into starter_template (type_id, module_id, dep_id, source_directory, relative_path, template_name, content, gmt_create, gmt_modified) values ";

    public static final String SQL_NAME = "starter_template.sql";

    /**
     * 脚手架类型唯一标识
     */
    String typeId;
    /**
     * 模块唯一标识
     */
    String moduleId;
    /**
     * 依赖唯一标识
     */
    String depId;
    /**
     * 源目录
     */
    String sourceDirectory;
    /**
     * 相对路径
     */
    String relativePath;
    /**
     * 模板名称
     */
    String templateName;
    /**
     * 内容
     */
    String content;

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public String getModuleId() {
        return moduleId;
    }

    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }

    public String getDepId() {
        return depId;
    }

    public void setDepId(String depId) {
        this.depId = depId;
    }

    public String getSourceDirectory() {
        return sourceDirectory;
    }

    public void setSourceDirectory(String sourceDirectory) {
        this.sourceDirectory = sourceDirectory;
    }

    public String getRelativePath() {
        return relativePath;
    }

    public void setRelativePath(String relativePath) {
        this.relativePath = relativePath;
    }

    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public List<Object> getSqlValues() {
        return Lists.newArrayList(
                this.typeId,
                this.moduleId,
                this.depId,
                this.sourceDirectory,
                this.relativePath,
                this.templateName,
                this.content,
                this.getGmtCreate(),
                this.getGmtModified()
        );
    }
}